package model;

import java.io.Serializable;
import java.util.Collection;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;

@Entity(name="Farmacia")
public class Farmacia implements Serializable {

	private static final long serialVersionUID = 2933721124893265639L;

	private Long codigo;
	private String nome;
	private String endereco;
	private String telefone;
	private Collection<Farmaceutico> farmaceuticos;
	
	@Column(name="FARMACIA_ID")
	@Id	@GeneratedValue(strategy = GenerationType.IDENTITY)
	public Long getCodigo() {
		return codigo;
	}
	
	public void setCodigo(Long codigo) {
		this.codigo = codigo;
	}
	
	@Column(nullable=false)
	public String getNome() {
		return nome;
	}
	
	public void setNome(String nome) {
		this.nome = nome;
	}
	
	public String getEndereco() {
		return endereco;
	}
	
	public void setEndereco(String endereco) {
		this.endereco = endereco;
	}
	
	public String getTelefone() {
		return telefone;
	}
	
	public void setTelefone(String telefone) {
		this.telefone = telefone;
	}

	@ManyToMany(mappedBy="farmacia")
	public Collection<Farmaceutico> getFarmaceuticos() {
		return farmaceuticos;
	}

	public void setFarmaceuticos(Collection<Farmaceutico> farmaceuticos) {
		this.farmaceuticos = farmaceuticos;
	}
	
}
